<?php echo $header; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
<div id="notification"></div>
<?php if ($success) { ?>
<div class="success"><?php echo $success; ?></div>
<?php } ?>
<?php
    $this->load->model('account/order');
    $orders = $this->model_account_order->getOrders();

    foreach ($orders as $order) {
        $order_status = $this->model_account_order->getOrder($order['order_id']);
        $product = $this->model_account_order->getOrderProducts($order['order_id']);

        if ($product[0]['product_id'] == '73' and $order_status['order_status_id'] == '5') {
            echo '<div id="column-left">' . $supermenu . '</div>';
        }
    }
?>
<?php //echo $column_left; ?><?php //echo $column_right; ?>
<div id="content" class="user_account"><?php echo $content_top; ?>
  <h1><?php echo $heading_title; ?></h1>
    <?php
    $address_id = $this->customer->getAddressId();
    $this->load->model('account/address');
    $address = $this->model_account_address->getAddress($address_id);
    $zone_id=$address['zone_id'];

    unset($address['company']);
    unset($address['company_id']);
    unset($address['tax_id']);
    unset($address['address_format']);

        if (in_array("", $address)) {
            echo '<p class="red">Для приобретения пакета "Старт" необходимо заполнить все поля</p>';
        } elseif ($product[0]['product_id'] == '73' and $order_status['order_status_id'] == '5') {
        echo '<h1 class="red" style="text-align: left">Вы приобрели пакет "Старт"</h1>';
        }else{
            echo '<h1 class="red" style="text-align: left">Для участия в "МБО Дом Блага" и доступа ко всем услугам, Вам необходимо оплатить пакет "Старт"</h1>';
                if (!$product[0]['product_id']=='73' and !$order_status['order_status_id']=='5') {
                echo '<div id="start"></div>';
            }
        }

    ?>
    <div class="h1-bb"></div>
    <!--<h2><?php echo $text_my_account; ?></h2>-->
    <script type="text/javascript">
        <!--
        $(document).ready(function() {
            $('#start').load('index.php?route=product/category&path=59 .cart');
            $('#edit').load('index.php?route=account/edit form');
            $('#password').load('index.php?route=account/password form');
            $("#address_update" ).load( "index.php?route=account/address/update&address_id=<?php echo $this->customer->getId(); ?> form", function() {
                $('select[name=\'country_id\']').bind('change', function() {
                    $.ajax({
                        url: 'index.php?route=account/address/country&country_id=' + this.value,
                        dataType: 'json',
                        beforeSend: function() {
                            $('select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="catalog/view/theme/palioxis/image/loading.gif" alt="" /></span>');
                        },
                        complete: function() {
                            $('.wait').remove();
                        },
                        success: function(json) {
                            if (json['postcode_required'] == '1') {
                                $('#postcode-required').show();
                            } else {
                                $('#postcode-required').hide();
                            }

                            html = '<option value=""><?php echo $text_select; ?></option>';

                            if (json['zone'] != '') {
                                for (i = 0; i < json['zone'].length; i++) {
                                    html += '<option value="' + json['zone'][i]['zone_id'] + '"';
                                    if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
                                        html += ' selected="selected"';
                                    }
                                    html += '>' + json['zone'][i]['name'] + '</option>';
                                }
                            } else {
                                html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
                            }

                            $('select[name=\'zone_id\']').html(html);
                        },
                        error: function(xhr, ajaxOptions, thrownError) {
                            alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
                        }
                    });
                });
                $('select[name=\'country_id\']').trigger('change');
            });
        });
        -->
    </script>
    <div class="w49p fll">
        <div id="edit"></div>
        <div id="password"></div>
        <p><strong>Ваша реферальная ссылка: </strong></p>
    </div>

    <div class="w49p flr">
        <div id="address_update"></div>
    </div>
    <div class="clr"></div>
  <!--<div class="content">
    <ul>
      <li><a href="<?php echo $edit; ?>"><?php echo $text_edit; ?></a></li>
      <li><a href="<?php echo $password; ?>"><?php echo $text_password; ?></a></li>
      <li><a href="<?php echo $address; ?>"><?php echo $text_address; ?></a></li>
      <li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist; ?></a></li>
    </ul>
  </div>
  <h2><?php echo $text_my_orders; ?></h2>
  <div class="content">
    <ul>
      <li><a href="<?php echo $order; ?>"><?php echo $text_order; ?></a></li>
      <li><a href="<?php echo $download; ?>"><?php echo $text_download; ?></a></li>
      <?php if ($reward) { ?>
      <li><a href="<?php echo $reward; ?>"><?php echo $text_reward; ?></a></li>
      <?php } ?>
      <li><a href="<?php echo $return; ?>"><?php echo $text_return; ?></a></li>
      <li><a href="<?php echo $transaction; ?>"><?php echo $text_transaction; ?></a></li>
    </ul>
  </div>
  <h2><?php echo $text_my_newsletter; ?></h2>
  <div class="content">
    <ul>
      <li><a href="<?php echo $newsletter; ?>"><?php echo $text_newsletter; ?></a></li>
    </ul>
  </div>-->
  <?php echo $content_bottom; ?></div>
<?php echo $footer; ?> 
